<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Invoice extends Model
{
    public function details()
    {
        return $this->hasMany(InvoiceDetails::class,'invoice_id','id');
    }

    public function school()
    {
        return $this->hasOne(School::class,'id','school_id')->bind(['name']);
    }


    public function student()
    {
        return $this->hasOne(Student::class,'id','student_id')->bind(['student_name'=>'name','student_number'=>'number']);
    }
}
